/**
 * Created by CZ on 2017/4/6.
 */
module.exports = function ($scope,$rootScope,$state,$localStorage,RequestService,commonConfig) {
    $scope.User = $localStorage.get('cloud');

    //获取当前用户信息
    RequestService.Request(commonConfig.userApi+'user/user/getUserById?id='+$scope.User.detail.id,'GET').then(function(response){
        console.log(response);
        $scope.UserMessage = response;
    },function(error){
        console.log(error);
    });


    //获取开发者client_id和client_secret
    RequestService.Request(commonConfig.userApi+'user/user/getDeveloperClientInfo?userId='+$scope.User.detail.id,'GET').then(function(response){
        console.log(response);
        $scope.UserClientInfo = response;
    },function(error){
        console.log(error);
    });


    //获取当前用户APP列表
    RequestService.Request(commonConfig.cloudApi+'cloud/app/getAppListByUserId?userId='+$scope.User.detail.id,'GET').then(function(response){
        console.log(response);
        $scope.Apps = response;
    },function(error){
        console.log(error);
    });

};